namespace = cr_mount

# Mount market entry.
character_event = {
	id = cr_mount.1
	title = CR_MOUNT_1_TITLE
	desc = CR_MOUNT_1_DESC
	picture = GFX_cr_evt_market_small
	is_triggered_only = yes
	trigger = { cr_mount_market_tier_1_trigger = yes }

	immediate = { cr_mount_calculate_market_costs_effect = yes }

	option = {
		name = CR_MOUNT_1_A
		long_character_event = { id = cr_mount.10 }
		ai_chance = {
			factor = 100
			modifier = {
				factor = 0
				any_artifact = { has_artifact_flag = cr_mount }
			}
		}
	}
	option = {
		name = CR_MOUNT_1_B
		long_character_event = { id = cr_mount.20 }
		ai_chance = { factor = 0 }
	}
	option = {
		name = CR_MOUNT_LEAVE
		cr_mount_clear_market_variables_effect = yes
		ai_chance = {
			factor = 0
			modifier = {
				factor = 100
				any_artifact = { has_artifact_flag = cr_mount }
			}
		}
	}
}

# Mount quality selection, first page.
long_character_event = {
	id = cr_mount.10
	title = CR_MOUNT_10_TITLE
	desc = CR_MOUNT_10_DESC
	picture = GFX_cr_evt_market_small
	is_triggered_only = yes
	trigger = { cr_mount_market_tier_1_trigger = yes }

	immediate = { cr_mount_calculate_market_costs_effect = yes }

	option = {
		name = CR_MOUNT_10_A
		long_character_event = { id = cr_mount.12 }
		ai_chance = {
			factor = 40
			modifier = { factor = 2 tier = COUNT }
			modifier = { factor = 2 tier = BARON }
		}
	}
	option = {
		name = CR_MOUNT_10_B
		trigger = { hidden_tooltip = { cr_mount_market_tier_2_trigger = yes } }
		long_character_event = { id = cr_mount.13 }
		ai_chance = {
			factor = 45
			modifier = { factor = 2 tier = DUKE }
		}
	}
	option = {
		name = CR_MOUNT_MORE
		trigger = { hidden_tooltip = { cr_mount_market_tier_3_trigger = yes } }
		long_character_event = { id = cr_mount.11 }
		ai_chance = {
			factor = 15
			modifier = { factor = 4 tier = KING }
			modifier = { factor = 6 tier = EMPEROR }
		}
	}
	option = {
		name = CR_MOUNT_BACK
		long_character_event = { id = cr_mount.1 }
		ai_chance = { factor = 0 }
	}
}

# Mount quality selection, second page.
long_character_event = {
	id = cr_mount.11
	title = CR_MOUNT_11_TITLE
	desc = CR_MOUNT_11_DESC
	picture = GFX_cr_evt_market_small
	is_triggered_only = yes
	trigger = { cr_mount_market_tier_3_trigger = yes }

	immediate = { cr_mount_calculate_market_costs_effect = yes }

	option = {
		name = CR_MOUNT_11_A
		trigger = { hidden_tooltip = { cr_mount_market_tier_3_trigger = yes } }
		long_character_event = { id = cr_mount.16 }
		ai_chance = {
			factor = 70
			modifier = { factor = 2 tier = KING }
		}
	}
	option = {
		name = CR_MOUNT_11_B
		trigger = { hidden_tooltip = { cr_mount_market_tier_4_trigger = yes } }
		long_character_event = { id = cr_mount.23 }
		ai_chance = {
			factor = 30
			modifier = { factor = 2 tier = EMPEROR }
		}
	}
	option = {
		name = CR_MOUNT_BACK
		long_character_event = { id = cr_mount.10 }
		ai_chance = { factor = 0 }
	}
	option = {
		name = CR_MOUNT_LEAVE
		cr_mount_clear_market_variables_effect = yes
		ai_chance = { factor = 0 }
	}
}

# Tier I mounts.
long_character_event = {
	id = cr_mount.12
	title = CR_MOUNT_TIER_1_TITLE
	desc = CR_MOUNT_TIER_1_DESC
	picture = GFX_cr_evt_market_small
	is_triggered_only = yes
	trigger = { cr_mount_market_tier_1_trigger = yes }

	immediate = { cr_mount_calculate_market_costs_effect = yes }

	option = {
		name = cr_mount_rouncey
		custom_tooltip = { text = CR_MOUNT_COST_5_TT }
		wealth = cr_mount_cost_5
		add_artifact = cr_mount_rouncey
		cr_mount_remember_new_artifact_effect = yes
		cr_mount_clear_market_variables_effect = yes
		long_character_event = { id = cr_mount.30 days = 1 }
		ai_chance = { factor = 60 }
	}
	option = {
		name = cr_mount_sumpter_horse
		custom_tooltip = { text = CR_MOUNT_COST_5_TT }
		wealth = cr_mount_cost_5
		add_artifact = cr_mount_sumpter_horse
		cr_mount_remember_new_artifact_effect = yes
		cr_mount_clear_market_variables_effect = yes
		long_character_event = { id = cr_mount.30 days = 1 }
		ai_chance = { factor = 40 }
	}
	option = {
		name = CR_MOUNT_BACK
		long_character_event = { id = cr_mount.10 }
		ai_chance = { factor = 0 }
	}
	option = {
		name = CR_MOUNT_LEAVE
		cr_mount_clear_market_variables_effect = yes
		ai_chance = { factor = 0 }
	}
}

# Tier II mounts, first page.
long_character_event = {
	id = cr_mount.13
	title = CR_MOUNT_TIER_2_TITLE
	desc = CR_MOUNT_TIER_2_DESC
	picture = GFX_cr_evt_market_small
	is_triggered_only = yes
	trigger = { cr_mount_market_tier_2_trigger = yes }

	immediate = { cr_mount_calculate_market_costs_effect = yes }

	option = {
		name = cr_mount_palfrey
		custom_tooltip = { text = CR_MOUNT_COST_10_TT }
		wealth = cr_mount_cost_10
		add_artifact = cr_mount_palfrey
		cr_mount_remember_new_artifact_effect = yes
		cr_mount_clear_market_variables_effect = yes
		long_character_event = { id = cr_mount.30 days = 1 }
		ai_chance = { factor = 20 }
	}
	option = {
		name = cr_mount_irish_hobby
		trigger = { capital_scope = { region = world_europe_west_brittania } }
		custom_tooltip = { text = CR_MOUNT_COST_10_TT }
		wealth = cr_mount_cost_10
		add_artifact = cr_mount_irish_hobby
		cr_mount_remember_new_artifact_effect = yes
		cr_mount_clear_market_variables_effect = yes
		long_character_event = { id = cr_mount.30 days = 1 }
		ai_chance = { factor = 100 }
	}
	option = {
		name = cr_mount_icelandic_horse
		trigger = { capital_scope = { region = world_europe_north } }
		custom_tooltip = { text = CR_MOUNT_COST_10_TT }
		wealth = cr_mount_cost_10
		add_artifact = cr_mount_icelandic_horse
		cr_mount_remember_new_artifact_effect = yes
		cr_mount_clear_market_variables_effect = yes
		long_character_event = { id = cr_mount.30 days = 1 }
		ai_chance = { factor = 50 }
	}
	option = {
		name = CR_MOUNT_MORE
		long_character_event = { id = cr_mount.14 }
		ai_chance = { factor = 5 }
	}
}

# Tier II mounts, second page.
long_character_event = {
	id = cr_mount.14
	title = CR_MOUNT_TIER_2_TITLE
	desc = CR_MOUNT_TIER_2_DESC
	picture = GFX_cr_evt_market_small
	is_triggered_only = yes
	trigger = { cr_mount_market_tier_2_trigger = yes }

	immediate = { cr_mount_calculate_market_costs_effect = yes }

	option = {
		name = cr_mount_fjord_horse
		trigger = { capital_scope = { region = world_europe_north } }
		custom_tooltip = { text = CR_MOUNT_COST_10_TT }
		wealth = cr_mount_cost_10
		add_artifact = cr_mount_fjord_horse
		cr_mount_remember_new_artifact_effect = yes
		cr_mount_clear_market_variables_effect = yes
		long_character_event = { id = cr_mount.30 days = 1 }
		ai_chance = { factor = 50 }
	}
	option = {
		name = cr_mount_iberian_jennet
		trigger = { capital_scope = { region = world_europe_west_iberia } }
		custom_tooltip = { text = CR_MOUNT_COST_10_TT }
		wealth = cr_mount_cost_10
		add_artifact = cr_mount_iberian_jennet
		cr_mount_remember_new_artifact_effect = yes
		cr_mount_clear_market_variables_effect = yes
		long_character_event = { id = cr_mount.30 days = 1 }
		ai_chance = { factor = 60 }
	}
	option = {
		name = cr_mount_galician_garrano
		trigger = { capital_scope = { region = world_europe_west_iberia } }
		custom_tooltip = { text = CR_MOUNT_COST_10_TT }
		wealth = cr_mount_cost_10
		add_artifact = cr_mount_galician_garrano
		cr_mount_remember_new_artifact_effect = yes
		cr_mount_clear_market_variables_effect = yes
		long_character_event = { id = cr_mount.30 days = 1 }
		ai_chance = { factor = 40 }
	}
	option = {
		name = CR_MOUNT_MORE
		long_character_event = { id = cr_mount.15 }
		ai_chance = { factor = 5 }
	}
}

# Tier II mounts, final page.
long_character_event = {
	id = cr_mount.15
	title = CR_MOUNT_TIER_2_TITLE
	desc = CR_MOUNT_TIER_2_DESC
	picture = GFX_cr_evt_market_small
	is_triggered_only = yes
	trigger = { cr_mount_market_tier_2_trigger = yes }

	immediate = { cr_mount_calculate_market_costs_effect = yes }

	option = {
		name = cr_mount_tibetan_pony
		trigger = { capital_scope = { region = world_himalayas } }
		custom_tooltip = { text = CR_MOUNT_COST_10_TT }
		wealth = cr_mount_cost_10
		add_artifact = cr_mount_tibetan_pony
		cr_mount_remember_new_artifact_effect = yes
		cr_mount_clear_market_variables_effect = yes
		long_character_event = { id = cr_mount.30 days = 1 }
		ai_chance = { factor = 100 }
	}
	option = {
		name = cr_mount_manipuri_pony
		trigger = { capital_scope = { region = world_india } }
		custom_tooltip = { text = CR_MOUNT_COST_10_TT }
		wealth = cr_mount_cost_10
		add_artifact = cr_mount_manipuri_pony
		cr_mount_remember_new_artifact_effect = yes
		cr_mount_clear_market_variables_effect = yes
		long_character_event = { id = cr_mount.30 days = 1 }
		ai_chance = { factor = 100 }
	}
	option = {
		name = CR_MOUNT_BACK
		long_character_event = { id = cr_mount.10 }
		ai_chance = { factor = 1 }
	}
	option = {
		name = CR_MOUNT_LEAVE
		cr_mount_clear_market_variables_effect = yes
		ai_chance = { factor = 1 }
	}
}

# Tier III mounts, first page.
long_character_event = {
	id = cr_mount.16
	title = CR_MOUNT_TIER_3_TITLE
	desc = CR_MOUNT_TIER_3_DESC
	picture = GFX_cr_evt_market_small
	is_triggered_only = yes
	trigger = { cr_mount_market_tier_3_trigger = yes }

	immediate = { cr_mount_calculate_market_costs_effect = yes }

	option = {
		name = cr_mount_courser
		custom_tooltip = { text = CR_MOUNT_COST_15_TT }
		wealth = cr_mount_cost_15
		add_artifact = cr_mount_courser
		cr_mount_remember_new_artifact_effect = yes
		cr_mount_clear_market_variables_effect = yes
		long_character_event = { id = cr_mount.30 days = 1 }
		ai_chance = { factor = 20 }
	}
	option = {
		name = cr_mount_frisian_horse
		trigger = {
			capital_scope = {
				OR = {
					region = world_europe_west_francia
					region = world_europe_west_germania
				}
			}
		}
		custom_tooltip = { text = CR_MOUNT_COST_15_TT }
		wealth = cr_mount_cost_15
		add_artifact = cr_mount_frisian_horse
		cr_mount_remember_new_artifact_effect = yes
		cr_mount_clear_market_variables_effect = yes
		long_character_event = { id = cr_mount.30 days = 1 }
		ai_chance = { factor = 100 }
	}
	option = {
		name = cr_mount_arabian
		trigger = {
			capital_scope = {
				OR = {
					region = world_middle_east
					region = world_africa_north
				}
			}
		}
		custom_tooltip = { text = CR_MOUNT_COST_15_TT }
		wealth = cr_mount_cost_15
		add_artifact = cr_mount_arabian
		cr_mount_remember_new_artifact_effect = yes
		cr_mount_clear_market_variables_effect = yes
		long_character_event = { id = cr_mount.30 days = 1 }
		ai_chance = { factor = 60 }
	}
	option = {
		name = CR_MOUNT_MORE
		long_character_event = { id = cr_mount.17 }
		ai_chance = { factor = 5 }
	}
}

# Tier III mounts, second page.
long_character_event = {
	id = cr_mount.17
	title = CR_MOUNT_TIER_3_TITLE
	desc = CR_MOUNT_TIER_3_DESC
	picture = GFX_cr_evt_market_small
	is_triggered_only = yes
	trigger = { cr_mount_market_tier_3_trigger = yes }

	immediate = { cr_mount_calculate_market_costs_effect = yes }

	option = {
		name = cr_mount_barb
		trigger = {
			capital_scope = {
				OR = {
					region = world_europe_west_iberia
					region = world_africa_north
				}
			}
		}
		custom_tooltip = { text = CR_MOUNT_COST_15_TT }
		wealth = cr_mount_cost_15
		add_artifact = cr_mount_barb
		cr_mount_remember_new_artifact_effect = yes
		cr_mount_clear_market_variables_effect = yes
		long_character_event = { id = cr_mount.30 days = 1 }
		ai_chance = { factor = 40 }
	}
	option = {
		name = cr_mount_turkoman
		trigger = {
			capital_scope = {
				OR = {
					region = world_steppe
					region = world_persia
				}
			}
		}
		custom_tooltip = { text = CR_MOUNT_COST_15_TT }
		wealth = cr_mount_cost_15
		add_artifact = cr_mount_turkoman
		cr_mount_remember_new_artifact_effect = yes
		cr_mount_clear_market_variables_effect = yes
		long_character_event = { id = cr_mount.30 days = 1 }
		ai_chance = { factor = 35 }
	}
	option = {
		name = cr_mount_persian_caspian
		trigger = { capital_scope = { region = world_persia } }
		custom_tooltip = { text = CR_MOUNT_COST_15_TT }
		wealth = cr_mount_cost_15
		add_artifact = cr_mount_persian_caspian
		cr_mount_remember_new_artifact_effect = yes
		cr_mount_clear_market_variables_effect = yes
		long_character_event = { id = cr_mount.30 days = 1 }
		ai_chance = { factor = 35 }
	}
	option = {
		name = CR_MOUNT_MORE
		long_character_event = { id = cr_mount.18 }
		ai_chance = { factor = 5 }
	}
}

# Tier III mounts, third page.
long_character_event = {
	id = cr_mount.18
	title = CR_MOUNT_TIER_3_TITLE
	desc = CR_MOUNT_TIER_3_DESC
	picture = GFX_cr_evt_market_small
	is_triggered_only = yes
	trigger = { cr_mount_market_tier_3_trigger = yes }

	immediate = { cr_mount_calculate_market_costs_effect = yes }

	option = {
		name = cr_mount_cuman_steppe_horse
		trigger = { capital_scope = { region = world_steppe } }
		custom_tooltip = { text = CR_MOUNT_COST_15_TT }
		wealth = cr_mount_cost_15
		add_artifact = cr_mount_cuman_steppe_horse
		cr_mount_remember_new_artifact_effect = yes
		cr_mount_clear_market_variables_effect = yes
		long_character_event = { id = cr_mount.30 days = 1 }
		ai_chance = { factor = 35 }
	}
	option = {
		name = cr_mount_jurchen_horse
		trigger = { capital_scope = { region = world_steppe_east } }
		custom_tooltip = { text = CR_MOUNT_COST_15_TT }
		wealth = cr_mount_cost_15
		add_artifact = cr_mount_jurchen_horse
		cr_mount_remember_new_artifact_effect = yes
		cr_mount_clear_market_variables_effect = yes
		long_character_event = { id = cr_mount.30 days = 1 }
		ai_chance = { factor = 35 }
	}
	option = {
		name = cr_mount_marwari
		trigger = { capital_scope = { region = world_india } }
		custom_tooltip = { text = CR_MOUNT_COST_15_TT }
		wealth = cr_mount_cost_15
		add_artifact = cr_mount_marwari
		cr_mount_remember_new_artifact_effect = yes
		cr_mount_clear_market_variables_effect = yes
		long_character_event = { id = cr_mount.30 days = 1 }
		ai_chance = { factor = 50 }
	}
	option = {
		name = CR_MOUNT_MORE
		long_character_event = { id = cr_mount.19 }
		ai_chance = { factor = 5 }
	}
}

# Tier III mounts, final page.
long_character_event = {
	id = cr_mount.19
	title = CR_MOUNT_TIER_3_TITLE
	desc = CR_MOUNT_TIER_3_DESC
	picture = GFX_cr_evt_market_small
	is_triggered_only = yes
	trigger = { cr_mount_market_tier_3_trigger = yes }

	immediate = { cr_mount_calculate_market_costs_effect = yes }

	option = {
		name = cr_mount_kathiawari
		trigger = { capital_scope = { region = world_india } }
		custom_tooltip = { text = CR_MOUNT_COST_15_TT }
		wealth = cr_mount_cost_15
		add_artifact = cr_mount_kathiawari
		cr_mount_remember_new_artifact_effect = yes
		cr_mount_clear_market_variables_effect = yes
		long_character_event = { id = cr_mount.30 days = 1 }
		ai_chance = { factor = 50 }
	}
	option = {
		name = cr_mount_dongola
		trigger = { capital_scope = { region = world_africa_east } }
		custom_tooltip = { text = CR_MOUNT_COST_15_TT }
		wealth = cr_mount_cost_15
		add_artifact = cr_mount_dongola
		cr_mount_remember_new_artifact_effect = yes
		cr_mount_clear_market_variables_effect = yes
		long_character_event = { id = cr_mount.30 days = 1 }
		ai_chance = { factor = 50 }
	}
	option = {
		name = cr_mount_abyssinian
		trigger = { capital_scope = { region = world_africa_east } }
		custom_tooltip = { text = CR_MOUNT_COST_15_TT }
		wealth = cr_mount_cost_15
		add_artifact = cr_mount_abyssinian
		cr_mount_remember_new_artifact_effect = yes
		cr_mount_clear_market_variables_effect = yes
		long_character_event = { id = cr_mount.30 days = 1 }
		ai_chance = { factor = 50 }
	}
	option = {
		name = CR_MOUNT_BACK
		long_character_event = { id = cr_mount.11 }
		ai_chance = { factor = 1 }
	}
}

# Tier IV mounts, first page.
long_character_event = {
	id = cr_mount.23
	title = CR_MOUNT_TIER_4_TITLE
	desc = CR_MOUNT_TIER_4_DESC
	picture = GFX_cr_evt_market_small
	is_triggered_only = yes
	trigger = { cr_mount_market_tier_4_trigger = yes }

	immediate = { cr_mount_calculate_market_costs_effect = yes }

	option = {
		name = cr_mount_charger
		custom_tooltip = { text = CR_MOUNT_COST_25_TT }
		wealth = cr_mount_cost_25
		add_artifact = cr_mount_charger
		cr_mount_remember_new_artifact_effect = yes
		cr_mount_clear_market_variables_effect = yes
		long_character_event = { id = cr_mount.30 days = 1 }
		ai_chance = { factor = 15 }
	}
	option = {
		name = cr_mount_destrier
		custom_tooltip = { text = CR_MOUNT_COST_25_TT }
		wealth = cr_mount_cost_25
		add_artifact = cr_mount_destrier
		cr_mount_remember_new_artifact_effect = yes
		cr_mount_clear_market_variables_effect = yes
		long_character_event = { id = cr_mount.30 days = 1 }
		ai_chance = { factor = 15 }
	}
	option = {
		name = cr_mount_norman_great_horse
		trigger = {
			capital_scope = {
				OR = {
					region = world_europe_west_francia
					region = world_europe_west_germania
				}
			}
		}
		custom_tooltip = { text = CR_MOUNT_COST_25_TT }
		wealth = cr_mount_cost_25
		add_artifact = cr_mount_norman_great_horse
		cr_mount_remember_new_artifact_effect = yes
		cr_mount_clear_market_variables_effect = yes
		long_character_event = { id = cr_mount.30 days = 1 }
		ai_chance = { factor = 100 }
	}
	option = {
		name = CR_MOUNT_MORE
		long_character_event = { id = cr_mount.24 }
		ai_chance = { factor = 5 }
	}
}

# Tier IV mounts, final page.
long_character_event = {
	id = cr_mount.24
	title = CR_MOUNT_TIER_4_TITLE
	desc = CR_MOUNT_TIER_4_DESC
	picture = GFX_cr_evt_market_small
	is_triggered_only = yes
	trigger = { cr_mount_market_tier_4_trigger = yes }

	immediate = { cr_mount_calculate_market_costs_effect = yes }

	option = {
		name = cr_mount_mongol_horse
		trigger = { capital_scope = { region = world_steppe } }
		custom_tooltip = { text = CR_MOUNT_COST_25_TT }
		wealth = cr_mount_cost_25
		add_artifact = cr_mount_mongol_horse
		cr_mount_remember_new_artifact_effect = yes
		cr_mount_clear_market_variables_effect = yes
		long_character_event = { id = cr_mount.30 days = 1 }
		ai_chance = { factor = 70 }
	}
	option = {
		name = cr_mount_ferghana
		trigger = {
			capital_scope = {
				OR = {
					region = world_persia
					region = world_steppe_east
				}
			}
		}
		custom_tooltip = { text = CR_MOUNT_COST_25_TT }
		wealth = cr_mount_cost_25
		add_artifact = cr_mount_ferghana
		cr_mount_remember_new_artifact_effect = yes
		cr_mount_clear_market_variables_effect = yes
		long_character_event = { id = cr_mount.30 days = 1 }
		ai_chance = { factor = 70 }
	}
	option = {
		name = CR_MOUNT_BACK
		long_character_event = { id = cr_mount.11 }
		ai_chance = { factor = 1 }
	}
	option = {
		name = CR_MOUNT_LEAVE
		cr_mount_clear_market_variables_effect = yes
		ai_chance = { factor = 1 }
	}
}

# Tack, first page.
long_character_event = {
	id = cr_mount.20
	title = CR_MOUNT_20_TITLE
	desc = CR_MOUNT_20_DESC
	picture = GFX_cr_evt_market_small
	is_triggered_only = yes
	trigger = { cr_mount_market_tier_1_trigger = yes }

	immediate = { cr_mount_calculate_market_costs_effect = yes }

	option = {
		name = CR_MOUNT_20_A
		trigger = { NOT = { any_artifact = { artifact_type = cr_mount_barding } }
			hidden_tooltip = { cr_mount_market_tier_3_trigger = yes }
		}
		custom_tooltip = { text = CR_MOUNT_COST_10_TT }
		wealth = cr_mount_cost_10
		add_artifact = cr_mount_barding
		cr_mount_remember_new_artifact_effect = yes
		cr_mount_clear_market_variables_effect = yes
		long_character_event = { id = cr_mount.30 days = 1 }
	}
	option = {
		name = CR_MOUNT_20_B
		trigger = { NOT = { any_artifact = { artifact_type = cr_mount_saddle } } }
		custom_tooltip = { text = CR_MOUNT_COST_5_TT }
		wealth = cr_mount_cost_5
		add_artifact = cr_mount_saddle
		cr_mount_remember_new_artifact_effect = yes
		cr_mount_clear_market_variables_effect = yes
		long_character_event = { id = cr_mount.30 days = 1 }
	}
	option = {
		name = CR_MOUNT_20_C
		trigger = { NOT = { any_artifact = { artifact_type = cr_mount_bridle } } }
		custom_tooltip = { text = CR_MOUNT_COST_5_TT }
		wealth = cr_mount_cost_5
		add_artifact = cr_mount_bridle
		cr_mount_remember_new_artifact_effect = yes
		cr_mount_clear_market_variables_effect = yes
		long_character_event = { id = cr_mount.30 days = 1 }
	}
	option = {
		name = CR_MOUNT_MORE
		long_character_event = { id = cr_mount.21 }
	}
}

# Tack, second page.
long_character_event = {
	id = cr_mount.21
	title = CR_MOUNT_20_TITLE
	desc = CR_MOUNT_21_DESC
	picture = GFX_cr_evt_market_small
	is_triggered_only = yes
	trigger = { cr_mount_market_tier_1_trigger = yes }

	immediate = { cr_mount_calculate_market_costs_effect = yes }

	option = {
		name = CR_MOUNT_21_A
		trigger = { NOT = { any_artifact = { artifact_type = cr_mount_horseshoes } } }
		custom_tooltip = { text = CR_MOUNT_COST_5_TT }
		wealth = cr_mount_cost_5
		add_artifact = cr_mount_horseshoes
		cr_mount_remember_new_artifact_effect = yes
		cr_mount_clear_market_variables_effect = yes
		long_character_event = { id = cr_mount.30 days = 1 }
	}
	option = {
		name = CR_MOUNT_21_B
		trigger = { NOT = { any_artifact = { artifact_type = cr_mount_caparison } }
			hidden_tooltip = { cr_mount_market_tier_2_trigger = yes }
		}
		custom_tooltip = { text = CR_MOUNT_COST_5_TT }
		wealth = cr_mount_cost_5
		add_artifact = cr_mount_caparison
		cr_mount_remember_new_artifact_effect = yes
		cr_mount_clear_market_variables_effect = yes
		long_character_event = { id = cr_mount.30 days = 1 }
	}
	option = {
		name = CR_MOUNT_21_C
		trigger = { NOT = { any_artifact = { artifact_type = cr_mount_saddlebags } } }
		custom_tooltip = { text = CR_MOUNT_COST_5_TT }
		wealth = cr_mount_cost_5
		add_artifact = cr_mount_saddlebags
		cr_mount_remember_new_artifact_effect = yes
		cr_mount_clear_market_variables_effect = yes
		long_character_event = { id = cr_mount.30 days = 1 }
	}
	option = {
		name = CR_MOUNT_MORE
		trigger = { hidden_tooltip = { cr_mount_market_tier_4_trigger = yes } }
		long_character_event = { id = cr_mount.22 }
	}
}

# Tack, final page.
long_character_event = {
	id = cr_mount.22
	title = CR_MOUNT_20_TITLE
	desc = CR_MOUNT_22_DESC
	picture = GFX_cr_evt_market_small
	is_triggered_only = yes
	trigger = { cr_mount_market_tier_4_trigger = yes }

	immediate = { cr_mount_calculate_market_costs_effect = yes }

	option = {
		name = CR_MOUNT_22_A
		trigger = { NOT = { any_artifact = { artifact_type = cr_mount_battle_standard } } }
		custom_tooltip = { text = CR_MOUNT_COST_10_TT }
		wealth = cr_mount_cost_10
		add_artifact = cr_mount_battle_standard
		cr_mount_remember_new_artifact_effect = yes
		cr_mount_clear_market_variables_effect = yes
		long_character_event = { id = cr_mount.30 days = 1 }
	}
	option = {
		name = CR_MOUNT_BACK
		long_character_event = { id = cr_mount.20 }
	}
	option = {
		name = CR_MOUNT_LEAVE
		cr_mount_clear_market_variables_effect = yes
	}
}

# Purchase result.
long_character_event = {
	id = cr_mount.30
	title = CR_MOUNT_30_TITLE
	desc = CR_MOUNT_30_DESC
	picture = GFX_cr_evt_horsemanship_small
	is_triggered_only = yes

	option = { name = CR_MOUNT_30_A }
}

# Combat damage to an equipped living mount.
long_character_event = {
	id = cr_mount.100
	title = CR_MOUNT_100_TITLE
	desc = {
		text = CR_MOUNT_100_DESC_HEALTHY
		trigger = { event_target:cr_mount_damaged = { has_artifact_flag = cr_mount_health_healthy } }
	}
	desc = {
		text = CR_MOUNT_100_DESC_INJURED
		trigger = { event_target:cr_mount_damaged = { has_artifact_flag = cr_mount_health_injured } }
	}
	desc = {
		text = CR_MOUNT_100_DESC_SERIOUS
		trigger = { event_target:cr_mount_damaged = { has_artifact_flag = cr_mount_health_serious } }
	}
	picture = GFX_cr_evt_horsemanship_small
	is_triggered_only = yes

	trigger = {
		is_adult = yes
		in_command = yes
		any_artifact = {
			has_artifact_flag = cr_mount
			is_artifact_equipped = yes
			NOT = { has_artifact_flag = cr_mount_immortal }
			NOT = { has_artifact_flag = cr_mount_health_dying }
		}
	}

	weight_multiplier = {
		days = 1
		modifier = { factor = 0.70 cr_has_equipped_mount_barding_trigger = yes }
		modifier = { factor = 1.35 trait = aggressive_leader }
		modifier = { factor = 1.25 trait = wroth }
	}

	immediate = {
		random_artifact = {
			limit = {
				has_artifact_flag = cr_mount
				is_artifact_equipped = yes
				NOT = { has_artifact_flag = cr_mount_immortal }
				NOT = { has_artifact_flag = cr_mount_health_dying }
			}
			save_event_target_as = cr_mount_damaged
		}
	}

	option = {
		name = CR_MOUNT_100_A
		event_target:cr_mount_damaged = { cr_mount_reduce_health_effect = yes }
	}
}

# Annual recovery and mortality controller.
long_character_event = {
	id = cr_mount.110
	hide_window = yes
	is_triggered_only = yes

	trigger = {
		any_artifact = {
			has_artifact_flag = cr_mount
			NOT = { has_artifact_flag = cr_mount_immortal }
			OR = {
				has_artifact_flag = cr_mount_health_injured
				has_artifact_flag = cr_mount_health_serious
				has_artifact_flag = cr_mount_health_dying
			}
		}
	}

	immediate = {
		if = {
			limit = {
				any_artifact = {
					has_artifact_flag = cr_mount
					has_artifact_flag = cr_mount_health_dying
					NOT = { has_artifact_flag = cr_mount_immortal }
				}
			}
			random_artifact = {
				limit = {
					has_artifact_flag = cr_mount
					has_artifact_flag = cr_mount_health_dying
					NOT = { has_artifact_flag = cr_mount_immortal }
				}
				save_event_target_as = cr_mount_recovering
			}
			if = {
				limit = { cr_has_advanced_capital_stables_trigger = yes }
				random_list = {
					75 = {
						event_target:cr_mount_recovering = { cr_mount_improve_health_effect = yes }
						long_character_event = { id = cr_mount.111 days = 1 }
					}
					25 = { long_character_event = { id = cr_mount.112 days = 1 } }
				}
			}
			else_if = {
				limit = { cr_has_capital_stables_trigger = yes }
				random_list = {
					60 = {
						event_target:cr_mount_recovering = { cr_mount_improve_health_effect = yes }
						long_character_event = { id = cr_mount.111 days = 1 }
					}
					40 = { long_character_event = { id = cr_mount.112 days = 1 } }
				}
			}
			else = {
				random_list = {
					25 = {
						event_target:cr_mount_recovering = { cr_mount_improve_health_effect = yes }
						long_character_event = { id = cr_mount.111 days = 1 }
					}
					75 = { long_character_event = { id = cr_mount.112 days = 1 } }
				}
			}
		}
		else = {
			random_artifact = {
				limit = {
					has_artifact_flag = cr_mount
					NOT = { has_artifact_flag = cr_mount_immortal }
					OR = {
						has_artifact_flag = cr_mount_health_injured
						has_artifact_flag = cr_mount_health_serious
					}
				}
				save_event_target_as = cr_mount_recovering
			}
			if = {
				limit = { cr_has_advanced_capital_stables_trigger = yes }
				event_target:cr_mount_recovering = { cr_mount_improve_health_effect = yes }
				long_character_event = { id = cr_mount.111 days = 1 }
			}
			else_if = {
				limit = { cr_has_capital_stables_trigger = yes }
				random_list = {
					75 = {
						event_target:cr_mount_recovering = { cr_mount_improve_health_effect = yes }
						long_character_event = { id = cr_mount.111 days = 1 }
					}
					25 = { }
				}
			}
			else = {
				random_list = {
					40 = {
						event_target:cr_mount_recovering = { cr_mount_improve_health_effect = yes }
						long_character_event = { id = cr_mount.111 days = 1 }
					}
					60 = { }
				}
			}
		}
	}
}

long_character_event = {
	id = cr_mount.111
	title = CR_MOUNT_111_TITLE
	desc = CR_MOUNT_111_DESC
	picture = GFX_cr_evt_horsemanship_small
	is_triggered_only = yes

	option = { name = CR_MOUNT_111_A }
}

long_character_event = {
	id = cr_mount.112
	title = CR_MOUNT_112_TITLE
	desc = CR_MOUNT_112_DESC
	picture = GFX_cr_evt_horsemanship_small
	is_triggered_only = yes

	option = {
		name = CR_MOUNT_112_A
		event_target:cr_mount_recovering = { unsafe_destroy_artifact = yes }
	}
}

# Inherited legacy mounts without one of CR's four health flags enter healthy.
long_character_event = {
	id = cr_mount.120
	hide_window = yes
	is_triggered_only = yes

	trigger = {
		FROM = { has_artifact_flag = cr_mount }
	}

	immediate = {
		FROM = { cr_mount_normalize_health_effect = yes }
	}
}

# Appointed commanders privately acquire one mount or piece of tack each year.
long_character_event = {
	id = cr_mount.130
	hide_window = yes
	is_triggered_only = yes

	trigger = {
		ai = yes
		is_adult = yes
		has_minor_title = title_commander
		wealth = 1
		prisoner = no
		NOT = { trait = incapable }
		NOT = { is_inaccessible_trigger = yes }
		OR = {
			NOT = { any_artifact = { has_artifact_flag = cr_mount } }
			AND = {
				any_artifact = { has_artifact_flag = cr_mount }
				cr_mount_commander_has_missing_basic_tack_trigger = yes
			}
			AND = {
				any_artifact = { has_artifact_flag = cr_mount }
				cr_mount_commander_has_missing_advanced_tack_trigger = yes
			}
		}
	}

	immediate = {
		if = {
			limit = { NOT = { any_artifact = { has_artifact_flag = cr_mount } } }
			cr_mount_commander_buy_mount_effect = yes
		}
		else_if = {
			limit = { cr_mount_commander_has_missing_basic_tack_trigger = yes }
			cr_mount_commander_buy_basic_tack_effect = yes
		}
		else_if = {
			limit = { cr_mount_commander_has_missing_advanced_tack_trigger = yes }
			cr_mount_commander_buy_advanced_tack_effect = yes
		}
	}
}
